///////////////////////////////////////////////////////////////////////
// WriteEngine2Event.h
//
// Wrapper for DWriteEngine2Events Interface Events
//
// Written by Nic Wilson
//

#pragma once
class CWriteEngine2;

// CWriteEngine2Event command target

class CWriteEngine2Event : public CCmdTarget
{
	DECLARE_DYNAMIC(CWriteEngine2Event)
private:
	LPTYPEINFO  m_ptinfo;           // ITest type information
	DWORD		m_dwCookie;
	LPUNKNOWN	m_pUnkSink;
	LPUNKNOWN	m_pUnkSrc;

	HWND		m_hNotifyWnd;

public:
	CWriteEngine2Event();
	virtual ~CWriteEngine2Event();

	static CWriteEngine2Event* CreateEventSink();

	bool ConnectWriteEngine2(CWriteEngine2*);
	inline void SetHwnd(HWND hWnd){m_hNotifyWnd = hWnd;}

    DECLARE_INTERFACE_MAP()

    BEGIN_INTERFACE_PART(WriteEngine2Events, DWriteEngine2Events)
		//
		// IDispatch Methods
		//
        STDMETHOD(GetTypeInfoCount)(UINT FAR* pctinfo);
        STDMETHOD(GetTypeInfo)(UINT itinfo, LCID lcid, ITypeInfo FAR* FAR* pptinfo);
        STDMETHOD(GetIDsOfNames)(REFIID riid, OLECHAR FAR* FAR* rgszNames,UINT cNames, LCID lcid, DISPID FAR* rgdispid);
        STDMETHOD(Invoke)(DISPID dispidMember, REFIID riid, LCID lcid,WORD wFlags, DISPPARAMS FAR* pdispparams, VARIANT FAR* pvarResult,EXCEPINFO FAR* pexcepinfo, UINT FAR* puArgErr);
		//
		// DWriteEngine2Events Methods
		//
		STDMETHOD_(HRESULT, Update)(LPDISPATCH, LPDISPATCH);
    END_INTERFACE_PART(WriteEngine2Events)

protected:
	DECLARE_MESSAGE_MAP()
};


